package com.devstringx.pmt.exception;

import org.apache.log4j.Logger;

import com.devstringx.pmt.utils.ApplicationUtilities;

public class PmtException extends Exception {
	
	private  Logger logger = Logger.getLogger(ApplicationUtilities.getExceptionLoggerName());

	private static final long serialVersionUID = 1L;

	public PmtException(Throwable cause) {
		super(cause);
	}

	public PmtException(String message, Throwable cause) {
		super(message, cause);

	}

	public PmtException(String message) {
		super(message);
	}

	@Override
	public void printStackTrace() {
		logger.error("", this);
	}

	public void logErrorToFile(String message) {
		logger.error(message);
	}

	public void logErrorToFile(String message, Throwable cause) {
		if (null != message) {
			logger.error(message, cause);

		} else {
			logger.error("", cause);
		}
	}
}
